package main

import "fmt"

func fib(ch chan int) {
	x := <-ch
	fmt.Printf("%d ", x)
	y := <-ch
	z := x + y
	ch <- y
	ch <- z
}

func main() {
	ch := make(chan int, 2)
	ch <- 0
	ch <- 1
	for i := 0; i < 100; i++ {
		fib(ch)
	}
	fmt.Println()
}
